package com.fzj.example.design.flyweight;

public class FlyweightPattern {
    public static void main(String[] args){
        FlyweightFactory flyweightFactory=new FlyweightFactory();
        Flyweight flyweight1 = flyweightFactory.getFlyweight("1");
        Flyweight flyweight2 = flyweightFactory.getFlyweight("1");

        Flyweight fl2 = flyweightFactory.getFlyweight("2");
        Flyweight fl22 = flyweightFactory.getFlyweight("2");
        Flyweight fl3 = flyweightFactory.getFlyweight("3");
        Flyweight fl33 = flyweightFactory.getFlyweight("3");
        flyweight1.createOption(new UnsharedConcreteFlyweight("第..次调用。"));
        flyweight2.createOption(new UnsharedConcreteFlyweight("第..次调用。"));
        fl2.createOption(new UnsharedConcreteFlyweight("第..次调用。"));
        fl22.createOption(new UnsharedConcreteFlyweight("第..次调用。"));
        fl3.createOption(new UnsharedConcreteFlyweight("第..次调用。"));
        fl33.createOption(new UnsharedConcreteFlyweight("第..次调用。"));
    }



}
